Carbon


PBReadForkSync

Header: Files.h Carbon status: Supported

Reads data from an open fork.

OSErr PBReadForkSync (
    FSForkIOParam *paramBlock
);
paramBlock

A pointer to a parameter block.

function result

A result code.

DISCUSSION

The relevant fields of the parameter block are:

The fork to be read should have been previously opened using the FSOpenFork call. Data is read starting at the position specified by positionMode and positionOffset. Up to requestCount bytes will be read into the buffer pointed at by the buffer parameter.

The fork’s current position is set to point immediately after the last byte read (that is, the initial position plus actualCount).

The caller can hint to the File Manager whether the data being read should or should not be cached by setting the appropriate bits in positionMode. (This is the same behavior as PBReadSync.) See “Position Mode Constants” for more information.

You may also add forceReadMask to positionMode. This tells the File Manager to force the data to be read directly from the disk. This is different from noCacheMask since forceReadMask will flush the appropriate part of the cache first, then ignore any data already in the cache. However, data that is read may be placed in the cache for future reads. The forceReadMask is also passed to the device driver, indicating that it should avoid reading from any device caches.

To verify that data previously written has been correctly transferred to disk, read it back in using forceReadMask and compare it with the data you previously wrote.

AVAILABILITY

Supported in Carbon. Available in Mac OS 9, and later when Carbon 1.0.2 or later is present.


© 2000 Apple Computer, Inc. — (Last Updated 5/8/2000)